package com.psl.rmon;

import com.psl.utils.MyMetaData;

import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;


public class TouchEvent implements View.OnTouchListener {
	private Button btn;
	
	public TouchEvent(Button btn) {
		this.btn = btn;
	}
	
	public boolean onTouch(View v, MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN) {
			if (v == btn) {
				v.setBackgroundColor(MyMetaData.downcolor);
			}
		} else if (event.getAction() == MotionEvent.ACTION_UP
				|| event.getAction() == MotionEvent.ACTION_OUTSIDE) {
			if (v == btn) {
				v.setBackgroundColor(MyMetaData.upcolor);
			}
		}
		return false;
	}
}